﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DLMemberPointMS.Entity;
using DLMemberPointMS.Entity.POCOModel;
using DLMemberPointMS.Common;
namespace DLMemberPointMS.Web.Controllers
{
    public class GiftIntegralController : Controller
    {
        // GET: GiftIntegral
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GiftIntegralView()
        {
            return View();
        }

        public ActionResult GetGiftIntegralView(string MC_CardID)
        {
            var db = new DLMPMSModel();
            var query = db.ExchangLogs.AsQueryable();
            if (!string.IsNullOrEmpty(MC_CardID))
            {
                query = query.Where(s => s.MC_CardID.Contains(MC_CardID));
            }
        
            var list = query.Select(s => new
            {
                s.MC_CardID,
                s.MC_Name,
                s.EG_ID,
                s.EL_CreateTime,
                s.EG_GiftName,
                s.EL_Point,
                s.EL_Number,



            }).ToList();
            var a = new
            {
                code = 0,
                msg = "成功",
                data = list
            };
            return Json(a, JsonRequestBehavior.AllowGet);
               
        }
    }
}